function clarinet(attack, sustain, release, Fs)
    ta = 0:1/Fs:(attack-1/Fs);
    y1 = exp(ta/attack*5)-1;
    y1 = y1/max(y1);
    y1 = [y1 ones(1,sustain*Fs)];

    tr = 0:1/Fs:(release/2-1/Fs);
    y3 = exp((release/2-tr)/release*3)-1;
    y3 = y3/max(y3)/2;
    y4 = 1-y3(length(y3):-1:1);
    
    y2 = [y1 ones(1,release*Fs)];
    y1 = [y1 y4 y3 0];  
    
    len = min([length(y1) length(y2)]);
    y1 = y1(1:len);     % I(t)
    y2 = y2(1:len);     % A(t)
    
    fc = 600;
    fm = 900;
    A = y1;
    I = max(y2)-(y2/2);
    
    %plot(I)
    duration = attack + sustain + release;
    data.A = A;
    data.I = I;
    data.fc = fc;
    data.fm = fm;
    modulated_frequency(duration,data,Fs);
end